package com.icss.train_sys_back.controller.home;

import com.icss.train_sys_back.entity.ResponseResult;
import com.icss.train_sys_back.entity.ticket_manage.TicketEntity;
import com.icss.train_sys_back.entity.train_manage.StationEntity;
import com.icss.train_sys_back.service.ticket_manage.TicketManageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author wk
 * @desc 用户端查询及购买车票业务
 * @date 2025/10/11 10:28
 */
@RestController
@RequestMapping("/home/ticket_manage")
@Slf4j
public class UserTicketManageController {
    @Autowired
    private TicketManageService ticketManageService;
    // 根据城市获取列车票务信息
    @GetMapping("/tickets")
    public ResponseResult getTrainTickets(@RequestParam String startCity,
                                              @RequestParam String endCity,
                                              @RequestParam String goDate) {

        List<TicketEntity> ticketEntities=ticketManageService.getTrainTickets(startCity, endCity, goDate);
        return ResponseResult.success(ticketEntities);
    }



}
